home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / corelib / ncbistd.h < prev    next >
Text File  |  1996-07-05  |  7KB  |  293 lines

  1. /*   ncbistd.h
  2. * ===========================================================================
  3. *
  4. *                            PUBLIC DOMAIN NOTICE
  5. *               National Center for Biotechnology Information
  6. *
  7. *  This software/database is a "United States Government Work" under the
  8. *  terms of the United States Copyright Act.  It was written as part of
  9. *  the author's official duties as a United States Government employee and
  10. *  thus cannot be copyrighted.  This software/database is freely available
  11. *  to the public for use. The National Library of Medicine and the U.S.
  12. *  Government have not placed any restriction on its use or reproduction.
  13. *
  14. *  Although all reasonable efforts have been taken to ensure the accuracy
  15. *  and reliability of the software and data, the NLM and the U.S.
  16. *  Government do not and cannot warrant the performance or results that
  17. *  may be obtained by using this software or data. The NLM and the U.S.
  18. *  Government disclaim all warranties, express or implied, including
  19. *  warranties of performance, merchantability or fitness for any particular
  20. *  purpose.
  21. *
  22. *  Please cite the author in any work or product based on this material.
  23. *
  24. * ===========================================================================
  25. *
  26. * File Name:  ncbistd.h
  27. *
  28. * Author:  Gish, Kans, Ostell, Schuler
  29. *
  30. * Version Creation Date:   1/1/91
  31. *
  32. * $Revision: 2.9 $
  33. *
  34. * File Description:
  35. *  This system-independent header supposedly works "as is"
  36. *  with the system-dependent header files available for these
  37. *  system/compiler combinations:
  38. *
  39. *    SunOS
  40. *    BSD UNIX
  41. *    SGI IRIX
  42. *    IBM AIX
  43. *    Cray UNICOS
  44. *    MS-DOS and Microsoft C compiler
  45. *    Macintosh with Apple MPW C and Symantec THINK C
  46. *
  47. * Modifications:
  48. * --------------------------------------------------------------------------
  49. * Date     Name        Description of modification
  50. * -------  ----------  -----------------------------------------------------
  51. * 04-12-93 Schuler     Misc. Windows-isms needed for DLL support
  52. * 12-16-93 Schuler     Added EXPORT to LIBCALL in _WINDLL case
  53. * ==========================================================================
  54. */
  55. #ifndef _NCBISTD_
  56. #define _NCBISTD_
  57.  
  58. #ifndef LITTLE_ENDIAN
  59. #define LITTLE_ENDIAN    1234
  60. #define BIG_ENDIAN    4321
  61. #define OTHER_ENDIAN    0
  62. #endif
  63.  
  64. #ifndef BYTE_ORDER
  65. #ifdef IS_LITTLE_ENDIAN
  66. #define BYTE_ORDER    LITTLE_ENDIAN
  67. #else
  68. #ifdef IS_BIG_ENDIAN
  69. #define BYTE_ORDER    BIG_ENDIAN
  70. #else
  71. #define BYTE_ORDER    OTHER_ENDIAN
  72. #endif
  73. #endif
  74. #endif
  75.  
  76. #ifndef INLINE
  77. #ifdef __cplusplus
  78. #define INLINE inline
  79. #else
  80. #define INLINE
  81. #endif
  82. #endif
  83.  
  84. /*----------------------------------------------------------------------*/
  85. /*      Aliased Logicals, Datatypes                                     */
  86. /*----------------------------------------------------------------------*/
  87. #ifndef PNTR
  88. #define PNTR    *
  89. #endif
  90. #ifndef HNDL
  91. #define HNDL    *
  92. #endif
  93.  
  94. /* dgg - DCLAP fix for Win16 where size_t is ! 16bit SHORT ! */
  95. /* meaning mem allocations > 64K fail w/ strange errors */
  96.  
  97. #define Nlm_sizeT   unsigned long
  98. #ifndef sizeT
  99. #define sizeT  Nlm_sizeT
  100. #endif
  101.  
  102.  
  103. #ifndef FnPtr
  104. typedef int        (*Nlm_FnPtr)();
  105. #define FnPtr        Nlm_FnPtr
  106. #endif
  107.  
  108. #ifndef VoidPtr
  109. typedef void PNTR    Nlm_VoidPtr;
  110. #define VoidPtr        Nlm_VoidPtr
  111. #endif
  112. #ifndef Pointer
  113. #define Pointer        Nlm_VoidPtr
  114. #endif
  115.  
  116. #ifndef Handle
  117. typedef void HNDL    Nlm_Handle;
  118. #define Handle        Nlm_Handle
  119. #endif
  120.  
  121. #ifndef Char
  122. typedef char        Nlm_Char, PNTR Nlm_CharPtr;
  123. #define Char        Nlm_Char
  124. #define CharPtr        Nlm_CharPtr
  125. #endif
  126.  
  127. #ifndef Uchar
  128. typedef unsigned char    Nlm_Uchar, PNTR Nlm_UcharPtr;
  129. #define Uchar        Nlm_Uchar
  130. #define UcharPtr    Nlm_UcharPtr
  131. #endif
  132.  
  133. #ifndef Boolean
  134. typedef unsigned char    Nlm_Boolean, PNTR Nlm_BoolPtr;
  135. #define Boolean        Nlm_Boolean
  136. #define BoolPtr        Nlm_BoolPtr
  137. #endif
  138.  
  139. #ifndef Byte
  140. typedef unsigned char    Nlm_Byte, PNTR Nlm_BytePtr;
  141. #define Byte        Nlm_Byte
  142. #define BytePtr        Nlm_BytePtr
  143. #define BYTE_MAX    UCHAR_MAX
  144. #endif
  145.  
  146. #ifndef Int1
  147. typedef signed char    Nlm_Int1, PNTR Nlm_Int1Ptr;
  148. #define Int1        Nlm_Int1
  149. #define Int1Ptr        Nlm_Int1Ptr
  150. #define INT1_MIN    SCHAR_MIN
  151. #define INT1_MAX    SCHAR_MAX
  152. #endif
  153.  
  154. #ifndef Uint1
  155. typedef unsigned char    Nlm_Uint1, PNTR Nlm_Uint1Ptr;
  156. #define Uint1        Nlm_Uint1
  157. #define Uint1Ptr    Nlm_Uint1Ptr
  158. #define UINT1_MAX    UCHAR_MAX
  159. #endif
  160.  
  161. #ifndef Int2
  162. typedef short        Nlm_Int2, PNTR Nlm_Int2Ptr;
  163. #define Int2        Nlm_Int2
  164. #define Int2Ptr        Nlm_Int2Ptr
  165. #define INT2_MIN    SHRT_MIN
  166. #define INT2_MAX    SHRT_MAX
  167. #endif
  168.  
  169. #ifndef Uint2
  170. typedef unsigned short    Nlm_Uint2, PNTR Nlm_Uint2Ptr;
  171. #define Uint2        Nlm_Uint2
  172. #define Uint2Ptr    Nlm_Uint2Ptr
  173. #define UINT2_MAX    USHRT_MAX
  174. #endif
  175.  
  176. #ifndef Int4
  177. typedef long        Nlm_Int4, PNTR Nlm_Int4Ptr;
  178. #define Int4        Nlm_Int4
  179. #define Int4Ptr        Nlm_Int4Ptr
  180. #define INT4_MIN    LONG_MIN
  181. #define INT4_MAX    LONG_MAX
  182. #endif
  183.  
  184. #ifndef Uint4
  185. typedef unsigned long    Nlm_Uint4, PNTR Nlm_Uint4Ptr;
  186. #define Uint4        Nlm_Uint4
  187. #define Uint4Ptr    Nlm_Uint4Ptr
  188. #define UINT4_MAX    ULONG_MAX
  189. #endif
  190.  
  191. #ifndef FloatLo
  192. typedef float        Nlm_FloatLo, PNTR Nlm_FloatLoPtr;
  193. #define FloatLo        Nlm_FloatLo
  194. #define FloatLoPtr    Nlm_FloatLoPtr
  195. #endif
  196.  
  197. #ifndef FloatHi
  198. typedef double        Nlm_FloatHi, PNTR Nlm_FloatHiPtr;
  199. #define FloatHi        Nlm_FloatHi
  200. #define FloatHiPtr    Nlm_FloatHiPtr
  201. #endif
  202.  
  203. /*----------------------------------------------------------------------*/
  204. /*      Misc Common Macros                                              */
  205. /*----------------------------------------------------------------------*/
  206. #ifndef SIZE_MAX
  207. #define SIZE_MAX    MAXALLOC
  208. #endif
  209.  
  210. #ifndef PATH_MAX
  211. #define PATH_MAX    FILENAME_MAX
  212. #endif
  213.  
  214. #ifndef NULL
  215. #define NULL ((void *)0)
  216. #endif
  217.  
  218. #ifndef NULLB
  219. #define NULLB '\0'
  220. #endif
  221.  
  222. #ifndef TRUE
  223. #define TRUE ((Nlm_Boolean)1)
  224. #endif
  225.  
  226. #ifndef FALSE
  227. #define FALSE ((Nlm_Boolean)0)
  228. #endif
  229.  
  230. #ifndef MIN
  231. #define MIN(a,b)    ((a)>(b)?(b):(a))
  232. #endif
  233.  
  234. #ifndef MAX
  235. #define MAX(a,b)    ((a)>=(b)?(a):(b))
  236. #endif
  237.  
  238. #ifndef ABS
  239. #define ABS(a)    ((a)>=0?(a):-(a))
  240. #endif
  241.  
  242. #ifndef SIGN
  243. #define SIGN(a)    ((a)>0?1:((a)<0?-1:0))
  244. #endif
  245.  
  246. #ifndef ROUNDUP       /* Round A up to the nearest multiple of B */
  247. #define ROUNDUP(A,B)    (((A)%(B)) != 0 ? (A)+(B)-((A)%(B)) : (A))
  248. #endif
  249.  
  250. #ifndef DIM
  251. #define DIM(A) (sizeof(A)/sizeof((A)[0]))
  252. #endif
  253.  
  254. #ifndef LN2
  255. #define LN2 (0.693147180559945)
  256. #endif
  257. #ifndef LN10
  258. #define LN10 (2.302585092994046)
  259. #endif
  260.  
  261. /*----------------------------------------------------------------------*/
  262. /*      Misc. MS-DOS-isms                                               */
  263. /*----------------------------------------------------------------------*/
  264. #ifndef NEAR
  265. #define NEAR
  266. #endif
  267. #ifndef FAR
  268. #define FAR
  269. #endif
  270. #ifndef CDECL
  271. #define CDECL
  272. #endif
  273. #ifndef PASCAL
  274. #define PASCAL
  275. #endif
  276. #ifndef EXPORT
  277. #define EXPORT
  278. #endif
  279.  
  280. #ifndef LIBCALL
  281. #ifdef _WINDLL
  282. #define LIBCALL        FAR PASCAL EXPORT
  283. #else
  284. #define LIBCALL        FAR PASCAL
  285. #endif
  286. #endif
  287.  
  288. #ifndef LIBCALLBACK
  289. #define LIBCALLBACK    FAR PASCAL
  290. #endif
  291.  
  292. #endif
  293.